#ifndef BLACKHOLE_H
#define BLACKHOLE_H

#include "Object.h"

  // spawns monsters near it
class BlackHole : public Object
{
    public:
        static const char BLACKHOLECHAR = '@';

        BlackHole( int x_ = -1, int y_ = -1, Field* f_ = 0, bool s = true,
                   int rate = 0, int cd = 0, int str = 0,
                   int currentCooldown = 0, Team team_ = TEAMDEMON )
            :Object( x_, y_, f_, s ), spawnRate( rate ), cooldown( cd ),
             currentCd( currentCooldown ), strength( str ), team(team_)
        {}
          // is called every time hole updates
        void update( int updateNumber );
          // damage can kill it
        void damage( int );
          // in case it dies, it explodes
        void explode();
          // does spawn demon team units
        void spawn();
        void save( ofstream*, ofstream* );

        Team getTeam() const { return team; }

        ~BlackHole() {}

        char getSymbol() const{ return BLACKHOLECHAR; }
    private:
          // amount of spawns per turn
        int spawnRate;
          // time it takes to recharge the spawning power
        int cooldown;
          // time it's left to recharging spawning power
        int currentCd;
          // how much damage can hole tank before exploding
        int strength;
          // team which this hole spawns
        Team team;
};

#endif // BLACKHOLE_H
